{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1b28a21b",
   "metadata": {},
   "source": [
    "## Numpy 作业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "781968bf",
   "metadata": {},
   "outputs": [],
   "source": [
    " import numpy as np\n",
    " import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3b4c50a8",
   "metadata": {},
   "source": [
    "### 1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "c936cc51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 37,   9, 131],\n",
       "       [120, 109,  81],\n",
       "       [130, 135, 126],\n",
       "       [ 61, 107, 147],\n",
       "       [ 30,  79, 120],\n",
       "       [ 21,  44,  92],\n",
       "       [ 11,  66, 149],\n",
       "       [ 24, 137,  20],\n",
       "       [ 98,  66,  72],\n",
       "       [ 93,  44,  72],\n",
       "       [129,   8,  26],\n",
       "       [ 14,  99, 121],\n",
       "       [ 58,  43, 144],\n",
       "       [116,  58,  94],\n",
       "       [ 60,  15,  51],\n",
       "       [ 57,  24, 109],\n",
       "       [ 30,  51,  67],\n",
       "       [  7,  26,  68],\n",
       "       [ 65,  53,  52],\n",
       "       [100,  50, 112],\n",
       "       [142, 130,  84],\n",
       "       [124,  12,  65],\n",
       "       [ 66,  33,  27],\n",
       "       [107,   9, 122],\n",
       "       [ 74,  67,  28],\n",
       "       [ 13, 100,  36],\n",
       "       [127,  30, 103],\n",
       "       [ 74,  23, 139],\n",
       "       [115, 130,  38],\n",
       "       [ 19, 145,  38],\n",
       "       [150,  96, 138],\n",
       "       [ 12, 141,  70],\n",
       "       [130,  43,  90],\n",
       "       [137, 148,   7],\n",
       "       [  1,  36,  40],\n",
       "       [ 39,  76, 134],\n",
       "       [ 19,  37,  88],\n",
       "       [ 51,  86,  47],\n",
       "       [ 54, 100,  75],\n",
       "       [ 65, 101,  94],\n",
       "       [ 11, 135,  14],\n",
       "       [ 59,  61, 135],\n",
       "       [ 12, 149,  15],\n",
       "       [ 46,  41,  15],\n",
       "       [131,  88,  92],\n",
       "       [132,  20,  19],\n",
       "       [ 51,  71,  31],\n",
       "       [ 17,  56, 142],\n",
       "       [ 80, 128,  92],\n",
       "       [ 73, 108,  64]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[  9,  90,  32],\n",
       "       [ 90,  42,  99],\n",
       "       [108,  41,   5],\n",
       "       [ 21, 142,  99],\n",
       "       [129, 122,  11],\n",
       "       [  9, 104,  10],\n",
       "       [144,  55,   6],\n",
       "       [ 38,   7,  15],\n",
       "       [110,  24,   0],\n",
       "       [  5, 141,  87],\n",
       "       [128,   3,  14],\n",
       "       [ 90, 136, 145],\n",
       "       [ 54, 147,  71],\n",
       "       [ 61,  44,  91],\n",
       "       [150, 125,  98],\n",
       "       [ 99,   5, 113],\n",
       "       [ 19,  20,  91],\n",
       "       [ 88,  97,  27],\n",
       "       [ 36,  92, 148],\n",
       "       [103,   5,  85],\n",
       "       [147, 112, 102],\n",
       "       [  5,  99, 121],\n",
       "       [ 78,  21, 101],\n",
       "       [141, 133,  66],\n",
       "       [116, 140,  78],\n",
       "       [ 26,  77,  15],\n",
       "       [ 36, 139,  97],\n",
       "       [ 56,  47,  29],\n",
       "       [ 61,  97,  37],\n",
       "       [107,  71,  32],\n",
       "       [ 97,  77,   8],\n",
       "       [ 97,  34,  95],\n",
       "       [ 98,  93,  55],\n",
       "       [ 63,  94,  55],\n",
       "       [ 65, 124,  89],\n",
       "       [105,  74, 117],\n",
       "       [ 83, 128, 147],\n",
       "       [ 82, 124,  11],\n",
       "       [ 13, 127,  16],\n",
       "       [ 88,  62,   0],\n",
       "       [ 51,  63, 147],\n",
       "       [ 26, 101, 103],\n",
       "       [ 16, 114,  71],\n",
       "       [ 95,  16,  73],\n",
       "       [  3, 127,  35],\n",
       "       [109,  55,  87],\n",
       "       [ 98,  46,  35],\n",
       "       [ 49,  94,  36],\n",
       "       [ 75,  10, 131],\n",
       "       [140, 146,  83]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[128,  32, 128],\n",
       "       [ 71, 126,  37],\n",
       "       [118, 111,  56],\n",
       "       [ 65,   1,   5],\n",
       "       [118,  52,   5],\n",
       "       [ 66,  97,   8],\n",
       "       [  6,   6,  59],\n",
       "       [113,  31, 126],\n",
       "       [109,   7, 137],\n",
       "       [ 30,  75,  29],\n",
       "       [120,  42, 109],\n",
       "       [ 33,   7,  57],\n",
       "       [ 79, 141, 100],\n",
       "       [141,  86,  96],\n",
       "       [ 62, 122,  26],\n",
       "       [ 33,  39, 139],\n",
       "       [ 90, 142, 114],\n",
       "       [113,  53, 117],\n",
       "       [132,  63,  59],\n",
       "       [ 69,  11, 145],\n",
       "       [146,  13,  85],\n",
       "       [ 51,  22,  99],\n",
       "       [149,  29,  10],\n",
       "       [130, 123,  60],\n",
       "       [ 16, 148, 148],\n",
       "       [148, 136,  68],\n",
       "       [ 83,  52,  77],\n",
       "       [ 62,  34, 137],\n",
       "       [ 10, 114, 143],\n",
       "       [ 35, 147, 109],\n",
       "       [ 88,  73,  81],\n",
       "       [ 71, 137,  98],\n",
       "       [  1,  60, 145],\n",
       "       [ 99, 116,  23],\n",
       "       [ 98,  10, 114],\n",
       "       [143,   5,  14],\n",
       "       [130,  61, 139],\n",
       "       [111,  59,  36],\n",
       "       [ 97,  70,  65],\n",
       "       [ 94,  50,  22],\n",
       "       [ 64,  73,  53],\n",
       "       [ 83, 120,  46],\n",
       "       [119,  12, 112],\n",
       "       [  5,  12,   0],\n",
       "       [107,  64, 101],\n",
       "       [122,  86,  33],\n",
       "       [ 47,  26, 149],\n",
       "       [ 45,  57,   5],\n",
       "       [120,  98,  82],\n",
       "       [133,  81, 125]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 61,  75,  34],\n",
       "       [  6,  62, 122],\n",
       "       [ 17,  61, 113],\n",
       "       [ 64,  59,  50],\n",
       "       [ 47,  22,  15],\n",
       "       [148,  10,  87],\n",
       "       [ 81,  17,  29],\n",
       "       [  9,  10, 129],\n",
       "       [ 19,   7, 116],\n",
       "       [ 65,  64,  14],\n",
       "       [ 20,  50, 117],\n",
       "       [100,  26,  39],\n",
       "       [119,  29,  40],\n",
       "       [  8,  95,  91],\n",
       "       [  2,  79,  67],\n",
       "       [ 82,  64,  39],\n",
       "       [ 62,  86, 147],\n",
       "       [ 65, 103,  24],\n",
       "       [123,  29,  62],\n",
       "       [  7, 129, 126],\n",
       "       [  6,  51, 145],\n",
       "       [ 98,  25, 146],\n",
       "       [ 99,  79,   1],\n",
       "       [ 27, 119,  63],\n",
       "       [ 18,   4, 140],\n",
       "       [ 85, 105,   0],\n",
       "       [148, 109,  23],\n",
       "       [135, 146, 136],\n",
       "       [ 90,  82,  83],\n",
       "       [ 81, 100,  31],\n",
       "       [ 65,  66,  61],\n",
       "       [ 36,  58,  14],\n",
       "       [ 43, 121,  89],\n",
       "       [141,   8,   4],\n",
       "       [134, 107,  99],\n",
       "       [ 85, 136,  32],\n",
       "       [ 33, 103,  41],\n",
       "       [ 78,  38,  65],\n",
       "       [ 68, 119, 135],\n",
       "       [121,  39,  27],\n",
       "       [ 25, 143,   3],\n",
       "       [ 13,  42,  81],\n",
       "       [ 79,  71,  49],\n",
       "       [134, 120,  66],\n",
       "       [118,  17,  64],\n",
       "       [ 27,  53,  91],\n",
       "       [ 47,  63, 112],\n",
       "       [ 70,  52,  75],\n",
       "       [ 99,  46,  48],\n",
       "       [114,  49,  66]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 18,  19,  77],\n",
       "       [135,   4,  83],\n",
       "       [ 92,  56, 108],\n",
       "       [134,  89,  54],\n",
       "       [ 73,  17,  37],\n",
       "       [ 20,  43,  77],\n",
       "       [ 62, 117,  23],\n",
       "       [ 96, 119,  27],\n",
       "       [ 15,   9,  98],\n",
       "       [ 62, 132,  30],\n",
       "       [120, 120,  78],\n",
       "       [ 78,  80, 112],\n",
       "       [122,  88,  94],\n",
       "       [ 99,  82,  20],\n",
       "       [ 31, 141,   6],\n",
       "       [ 88,  66, 113],\n",
       "       [110, 142,  99],\n",
       "       [ 17,  42, 137],\n",
       "       [ 85,  81,  64],\n",
       "       [ 86,  74, 115],\n",
       "       [150, 125,  64],\n",
       "       [ 61,  51,  12],\n",
       "       [ 10,  45, 141],\n",
       "       [ 82,  99, 145],\n",
       "       [100, 123, 101],\n",
       "       [ 64, 108,  46],\n",
       "       [ 11,  95, 107],\n",
       "       [115,  68, 124],\n",
       "       [123,  83, 141],\n",
       "       [114, 125,  10],\n",
       "       [ 10,  82,   5],\n",
       "       [ 51,   7,  81],\n",
       "       [134,   5,  54],\n",
       "       [ 95,  89,  25],\n",
       "       [127,  59, 122],\n",
       "       [ 63, 104,  37],\n",
       "       [ 92,  70,  43],\n",
       "       [  1,  17,  40],\n",
       "       [ 90, 107, 120],\n",
       "       [ 60,  81, 110],\n",
       "       [ 55,   6,  45],\n",
       "       [ 30,  76,  13],\n",
       "       [ 38, 103, 101],\n",
       "       [128,  89,  34],\n",
       "       [ 85, 129,  39],\n",
       "       [ 93,   1, 141],\n",
       "       [128, 102, 105],\n",
       "       [ 95,  49,  37],\n",
       "       [ 25, 143,  13],\n",
       "       [ 41, 142, 105]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[113,   5, 124],\n",
       "       [ 40, 118,  68],\n",
       "       [ 92,  91,  21],\n",
       "       [ 95,  23, 122],\n",
       "       [101, 109,  67],\n",
       "       [ 37,  54,  24],\n",
       "       [ 83,  81,  56],\n",
       "       [ 23,   2, 126],\n",
       "       [ 14, 107, 125],\n",
       "       [ 18, 112,  34],\n",
       "       [ 92, 138,  46],\n",
       "       [ 94, 125,  29],\n",
       "       [149, 150,  79],\n",
       "       [ 44,  15, 131],\n",
       "       [ 60,  85, 116],\n",
       "       [132,  36,  58],\n",
       "       [111,  57,  71],\n",
       "       [ 14,  19, 111],\n",
       "       [ 81,  26, 115],\n",
       "       [102, 111,  10],\n",
       "       [ 86,  87,  79],\n",
       "       [ 65,  18,   5],\n",
       "       [  8,  55,   5],\n",
       "       [ 91,  44, 114],\n",
       "       [125, 117,   7],\n",
       "       [ 89,  68,  17],\n",
       "       [ 45, 150, 125],\n",
       "       [ 63,  40,  84],\n",
       "       [ 33,  27,  61],\n",
       "       [ 60,  86,  44],\n",
       "       [ 92, 108,  80],\n",
       "       [146,  87, 116],\n",
       "       [  6,  26, 132],\n",
       "       [ 33, 104,  43],\n",
       "       [126,  67,  18],\n",
       "       [ 79,  20,   0],\n",
       "       [ 73,  58,   1],\n",
       "       [ 47,  21,  38],\n",
       "       [ 94, 146, 137],\n",
       "       [ 79,  39, 129],\n",
       "       [ 14,  53,  63],\n",
       "       [149,  57,  68],\n",
       "       [142,  46,  17],\n",
       "       [  5, 135,  51],\n",
       "       [ 66,  15, 135],\n",
       "       [ 86,   1, 109],\n",
       "       [136, 100, 129],\n",
       "       [ 41,  98,  97],\n",
       "       [135, 138,   3],\n",
       "       [ 55,  27,  50]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "Class1=np.random.randint(0,151,size=(50,3)) \n",
    "Class1\n",
    "Class2=np.random.randint(0,151,size=(50,3)) \n",
    "Class2\n",
    "Class3=np.random.randint(0,151,size=(50,3)) \n",
    "Class3\n",
    "Class4=np.random.randint(0,151,size=(50,3)) \n",
    "Class4\n",
    "Class5=np.random.randint(0,151,size=(50,3)) \n",
    "Class5\n",
    "Class6=np.random.randint(0,151,size=(50,3)) \n",
    "Class6\n",
    "display(Class1,Class2,Class3,Class4,Class5,Class6)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8ed48973",
   "metadata": {},
   "source": [
    " ### 2.将六个班的考试成绩进行合并得到score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8df12029",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 37,   9, 131],\n",
       "       [120, 109,  81],\n",
       "       [130, 135, 126],\n",
       "       [ 61, 107, 147],\n",
       "       [ 30,  79, 120],\n",
       "       [ 21,  44,  92],\n",
       "       [ 11,  66, 149],\n",
       "       [ 24, 137,  20],\n",
       "       [ 98,  66,  72],\n",
       "       [ 93,  44,  72],\n",
       "       [129,   8,  26],\n",
       "       [ 14,  99, 121],\n",
       "       [ 58,  43, 144],\n",
       "       [116,  58,  94],\n",
       "       [ 60,  15,  51],\n",
       "       [ 57,  24, 109],\n",
       "       [ 30,  51,  67],\n",
       "       [  7,  26,  68],\n",
       "       [ 65,  53,  52],\n",
       "       [100,  50, 112],\n",
       "       [142, 130,  84],\n",
       "       [124,  12,  65],\n",
       "       [ 66,  33,  27],\n",
       "       [107,   9, 122],\n",
       "       [ 74,  67,  28],\n",
       "       [ 13, 100,  36],\n",
       "       [127,  30, 103],\n",
       "       [ 74,  23, 139],\n",
       "       [115, 130,  38],\n",
       "       [ 19, 145,  38],\n",
       "       [150,  96, 138],\n",
       "       [ 12, 141,  70],\n",
       "       [130,  43,  90],\n",
       "       [137, 148,   7],\n",
       "       [  1,  36,  40],\n",
       "       [ 39,  76, 134],\n",
       "       [ 19,  37,  88],\n",
       "       [ 51,  86,  47],\n",
       "       [ 54, 100,  75],\n",
       "       [ 65, 101,  94],\n",
       "       [ 11, 135,  14],\n",
       "       [ 59,  61, 135],\n",
       "       [ 12, 149,  15],\n",
       "       [ 46,  41,  15],\n",
       "       [131,  88,  92],\n",
       "       [132,  20,  19],\n",
       "       [ 51,  71,  31],\n",
       "       [ 17,  56, 142],\n",
       "       [ 80, 128,  92],\n",
       "       [ 73, 108,  64],\n",
       "       [  9,  90,  32],\n",
       "       [ 90,  42,  99],\n",
       "       [108,  41,   5],\n",
       "       [ 21, 142,  99],\n",
       "       [129, 122,  11],\n",
       "       [  9, 104,  10],\n",
       "       [144,  55,   6],\n",
       "       [ 38,   7,  15],\n",
       "       [110,  24,   0],\n",
       "       [  5, 141,  87],\n",
       "       [128,   3,  14],\n",
       "       [ 90, 136, 145],\n",
       "       [ 54, 147,  71],\n",
       "       [ 61,  44,  91],\n",
       "       [150, 125,  98],\n",
       "       [ 99,   5, 113],\n",
       "       [ 19,  20,  91],\n",
       "       [ 88,  97,  27],\n",
       "       [ 36,  92, 148],\n",
       "       [103,   5,  85],\n",
       "       [147, 112, 102],\n",
       "       [  5,  99, 121],\n",
       "       [ 78,  21, 101],\n",
       "       [141, 133,  66],\n",
       "       [116, 140,  78],\n",
       "       [ 26,  77,  15],\n",
       "       [ 36, 139,  97],\n",
       "       [ 56,  47,  29],\n",
       "       [ 61,  97,  37],\n",
       "       [107,  71,  32],\n",
       "       [ 97,  77,   8],\n",
       "       [ 97,  34,  95],\n",
       "       [ 98,  93,  55],\n",
       "       [ 63,  94,  55],\n",
       "       [ 65, 124,  89],\n",
       "       [105,  74, 117],\n",
       "       [ 83, 128, 147],\n",
       "       [ 82, 124,  11],\n",
       "       [ 13, 127,  16],\n",
       "       [ 88,  62,   0],\n",
       "       [ 51,  63, 147],\n",
       "       [ 26, 101, 103],\n",
       "       [ 16, 114,  71],\n",
       "       [ 95,  16,  73],\n",
       "       [  3, 127,  35],\n",
       "       [109,  55,  87],\n",
       "       [ 98,  46,  35],\n",
       "       [ 49,  94,  36],\n",
       "       [ 75,  10, 131],\n",
       "       [140, 146,  83],\n",
       "       [128,  32, 128],\n",
       "       [ 71, 126,  37],\n",
       "       [118, 111,  56],\n",
       "       [ 65,   1,   5],\n",
       "       [118,  52,   5],\n",
       "       [ 66,  97,   8],\n",
       "       [  6,   6,  59],\n",
       "       [113,  31, 126],\n",
       "       [109,   7, 137],\n",
       "       [ 30,  75,  29],\n",
       "       [120,  42, 109],\n",
       "       [ 33,   7,  57],\n",
       "       [ 79, 141, 100],\n",
       "       [141,  86,  96],\n",
       "       [ 62, 122,  26],\n",
       "       [ 33,  39, 139],\n",
       "       [ 90, 142, 114],\n",
       "       [113,  53, 117],\n",
       "       [132,  63,  59],\n",
       "       [ 69,  11, 145],\n",
       "       [146,  13,  85],\n",
       "       [ 51,  22,  99],\n",
       "       [149,  29,  10],\n",
       "       [130, 123,  60],\n",
       "       [ 16, 148, 148],\n",
       "       [148, 136,  68],\n",
       "       [ 83,  52,  77],\n",
       "       [ 62,  34, 137],\n",
       "       [ 10, 114, 143],\n",
       "       [ 35, 147, 109],\n",
       "       [ 88,  73,  81],\n",
       "       [ 71, 137,  98],\n",
       "       [  1,  60, 145],\n",
       "       [ 99, 116,  23],\n",
       "       [ 98,  10, 114],\n",
       "       [143,   5,  14],\n",
       "       [130,  61, 139],\n",
       "       [111,  59,  36],\n",
       "       [ 97,  70,  65],\n",
       "       [ 94,  50,  22],\n",
       "       [ 64,  73,  53],\n",
       "       [ 83, 120,  46],\n",
       "       [119,  12, 112],\n",
       "       [  5,  12,   0],\n",
       "       [107,  64, 101],\n",
       "       [122,  86,  33],\n",
       "       [ 47,  26, 149],\n",
       "       [ 45,  57,   5],\n",
       "       [120,  98,  82],\n",
       "       [133,  81, 125],\n",
       "       [ 61,  75,  34],\n",
       "       [  6,  62, 122],\n",
       "       [ 17,  61, 113],\n",
       "       [ 64,  59,  50],\n",
       "       [ 47,  22,  15],\n",
       "       [148,  10,  87],\n",
       "       [ 81,  17,  29],\n",
       "       [  9,  10, 129],\n",
       "       [ 19,   7, 116],\n",
       "       [ 65,  64,  14],\n",
       "       [ 20,  50, 117],\n",
       "       [100,  26,  39],\n",
       "       [119,  29,  40],\n",
       "       [  8,  95,  91],\n",
       "       [  2,  79,  67],\n",
       "       [ 82,  64,  39],\n",
       "       [ 62,  86, 147],\n",
       "       [ 65, 103,  24],\n",
       "       [123,  29,  62],\n",
       "       [  7, 129, 126],\n",
       "       [  6,  51, 145],\n",
       "       [ 98,  25, 146],\n",
       "       [ 99,  79,   1],\n",
       "       [ 27, 119,  63],\n",
       "       [ 18,   4, 140],\n",
       "       [ 85, 105,   0],\n",
       "       [148, 109,  23],\n",
       "       [135, 146, 136],\n",
       "       [ 90,  82,  83],\n",
       "       [ 81, 100,  31],\n",
       "       [ 65,  66,  61],\n",
       "       [ 36,  58,  14],\n",
       "       [ 43, 121,  89],\n",
       "       [141,   8,   4],\n",
       "       [134, 107,  99],\n",
       "       [ 85, 136,  32],\n",
       "       [ 33, 103,  41],\n",
       "       [ 78,  38,  65],\n",
       "       [ 68, 119, 135],\n",
       "       [121,  39,  27],\n",
       "       [ 25, 143,   3],\n",
       "       [ 13,  42,  81],\n",
       "       [ 79,  71,  49],\n",
       "       [134, 120,  66],\n",
       "       [118,  17,  64],\n",
       "       [ 27,  53,  91],\n",
       "       [ 47,  63, 112],\n",
       "       [ 70,  52,  75],\n",
       "       [ 99,  46,  48],\n",
       "       [114,  49,  66],\n",
       "       [ 18,  19,  77],\n",
       "       [135,   4,  83],\n",
       "       [ 92,  56, 108],\n",
       "       [134,  89,  54],\n",
       "       [ 73,  17,  37],\n",
       "       [ 20,  43,  77],\n",
       "       [ 62, 117,  23],\n",
       "       [ 96, 119,  27],\n",
       "       [ 15,   9,  98],\n",
       "       [ 62, 132,  30],\n",
       "       [120, 120,  78],\n",
       "       [ 78,  80, 112],\n",
       "       [122,  88,  94],\n",
       "       [ 99,  82,  20],\n",
       "       [ 31, 141,   6],\n",
       "       [ 88,  66, 113],\n",
       "       [110, 142,  99],\n",
       "       [ 17,  42, 137],\n",
       "       [ 85,  81,  64],\n",
       "       [ 86,  74, 115],\n",
       "       [150, 125,  64],\n",
       "       [ 61,  51,  12],\n",
       "       [ 10,  45, 141],\n",
       "       [ 82,  99, 145],\n",
       "       [100, 123, 101],\n",
       "       [ 64, 108,  46],\n",
       "       [ 11,  95, 107],\n",
       "       [115,  68, 124],\n",
       "       [123,  83, 141],\n",
       "       [114, 125,  10],\n",
       "       [ 10,  82,   5],\n",
       "       [ 51,   7,  81],\n",
       "       [134,   5,  54],\n",
       "       [ 95,  89,  25],\n",
       "       [127,  59, 122],\n",
       "       [ 63, 104,  37],\n",
       "       [ 92,  70,  43],\n",
       "       [  1,  17,  40],\n",
       "       [ 90, 107, 120],\n",
       "       [ 60,  81, 110],\n",
       "       [ 55,   6,  45],\n",
       "       [ 30,  76,  13],\n",
       "       [ 38, 103, 101],\n",
       "       [128,  89,  34],\n",
       "       [ 85, 129,  39],\n",
       "       [ 93,   1, 141],\n",
       "       [128, 102, 105],\n",
       "       [ 95,  49,  37],\n",
       "       [ 25, 143,  13],\n",
       "       [ 41, 142, 105],\n",
       "       [113,   5, 124],\n",
       "       [ 40, 118,  68],\n",
       "       [ 92,  91,  21],\n",
       "       [ 95,  23, 122],\n",
       "       [101, 109,  67],\n",
       "       [ 37,  54,  24],\n",
       "       [ 83,  81,  56],\n",
       "       [ 23,   2, 126],\n",
       "       [ 14, 107, 125],\n",
       "       [ 18, 112,  34],\n",
       "       [ 92, 138,  46],\n",
       "       [ 94, 125,  29],\n",
       "       [149, 150,  79],\n",
       "       [ 44,  15, 131],\n",
       "       [ 60,  85, 116],\n",
       "       [132,  36,  58],\n",
       "       [111,  57,  71],\n",
       "       [ 14,  19, 111],\n",
       "       [ 81,  26, 115],\n",
       "       [102, 111,  10],\n",
       "       [ 86,  87,  79],\n",
       "       [ 65,  18,   5],\n",
       "       [  8,  55,   5],\n",
       "       [ 91,  44, 114],\n",
       "       [125, 117,   7],\n",
       "       [ 89,  68,  17],\n",
       "       [ 45, 150, 125],\n",
       "       [ 63,  40,  84],\n",
       "       [ 33,  27,  61],\n",
       "       [ 60,  86,  44],\n",
       "       [ 92, 108,  80],\n",
       "       [146,  87, 116],\n",
       "       [  6,  26, 132],\n",
       "       [ 33, 104,  43],\n",
       "       [126,  67,  18],\n",
       "       [ 79,  20,   0],\n",
       "       [ 73,  58,   1],\n",
       "       [ 47,  21,  38],\n",
       "       [ 94, 146, 137],\n",
       "       [ 79,  39, 129],\n",
       "       [ 14,  53,  63],\n",
       "       [149,  57,  68],\n",
       "       [142,  46,  17],\n",
       "       [  5, 135,  51],\n",
       "       [ 66,  15, 135],\n",
       "       [ 86,   1, 109],\n",
       "       [136, 100, 129],\n",
       "       [ 41,  98,  97],\n",
       "       [135, 138,   3],\n",
       "       [ 55,  27,  50]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " Score=np.concatenate([Class1,Class2,Class3,Class4,Class5,Class6])\n",
    " Score"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7d8d5d0",
   "metadata": {},
   "source": [
    "### 3.生成性别数组sex，水平叠加数组sex和score得到data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "11c68778",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 37,   9, 131,   0],\n",
       "       [120, 109,  81,   0],\n",
       "       [130, 135, 126,   1],\n",
       "       ...,\n",
       "       [ 41,  98,  97,   1],\n",
       "       [135, 138,   3,   1],\n",
       "       [ 55,  27,  50,   1]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " sex = np.random.randint(0,2,size=(300,1))\n",
    " data =np.hstack((Score,sex))      #第一方法\n",
    " data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "078b97ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 37,   9, 131,   0],\n",
       "       [120, 109,  81,   0],\n",
       "       [130, 135, 126,   1],\n",
       "       ...,\n",
       "       [ 41,  98,  97,   1],\n",
       "       [135, 138,   3,   1],\n",
       "       [ 55,  27,  50,   1]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " data=np.concatenate([Score,sex],axis = 1)   #第二方法\n",
    " data     "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1d5709a6",
   "metadata": {},
   "outputs": [],
   "source": [
    " 假设0是女生，1是男生 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "e4afc1da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 37,   9, 131,   0],\n",
       "       [120, 109,  81,   0],\n",
       "       [ 30,  79, 120,   0],\n",
       "       [ 24, 137,  20,   0],\n",
       "       [116,  58,  94,   0],\n",
       "       [ 65,  53,  52,   0],\n",
       "       [100,  50, 112,   0],\n",
       "       [124,  12,  65,   0],\n",
       "       [107,   9, 122,   0],\n",
       "       [ 74,  67,  28,   0],\n",
       "       [ 13, 100,  36,   0],\n",
       "       [127,  30, 103,   0],\n",
       "       [ 74,  23, 139,   0],\n",
       "       [ 12, 141,  70,   0],\n",
       "       [130,  43,  90,   0],\n",
       "       [137, 148,   7,   0],\n",
       "       [  1,  36,  40,   0],\n",
       "       [ 51,  86,  47,   0],\n",
       "       [ 65, 101,  94,   0],\n",
       "       [ 11, 135,  14,   0],\n",
       "       [ 59,  61, 135,   0],\n",
       "       [131,  88,  92,   0],\n",
       "       [132,  20,  19,   0],\n",
       "       [ 17,  56, 142,   0],\n",
       "       [ 80, 128,  92,   0],\n",
       "       [ 73, 108,  64,   0],\n",
       "       [  9,  90,  32,   0],\n",
       "       [ 90,  42,  99,   0],\n",
       "       [108,  41,   5,   0],\n",
       "       [  9, 104,  10,   0],\n",
       "       [144,  55,   6,   0],\n",
       "       [128,   3,  14,   0],\n",
       "       [ 90, 136, 145,   0],\n",
       "       [ 54, 147,  71,   0],\n",
       "       [150, 125,  98,   0],\n",
       "       [ 19,  20,  91,   0],\n",
       "       [103,   5,  85,   0],\n",
       "       [147, 112, 102,   0],\n",
       "       [  5,  99, 121,   0],\n",
       "       [141, 133,  66,   0],\n",
       "       [116, 140,  78,   0],\n",
       "       [ 26,  77,  15,   0],\n",
       "       [ 56,  47,  29,   0],\n",
       "       [107,  71,  32,   0],\n",
       "       [ 97,  77,   8,   0],\n",
       "       [ 97,  34,  95,   0],\n",
       "       [ 98,  93,  55,   0],\n",
       "       [ 65, 124,  89,   0],\n",
       "       [ 88,  62,   0,   0],\n",
       "       [ 16, 114,  71,   0],\n",
       "       [  3, 127,  35,   0],\n",
       "       [109,  55,  87,   0],\n",
       "       [ 98,  46,  35,   0],\n",
       "       [ 75,  10, 131,   0],\n",
       "       [118, 111,  56,   0],\n",
       "       [118,  52,   5,   0],\n",
       "       [ 66,  97,   8,   0],\n",
       "       [  6,   6,  59,   0],\n",
       "       [113,  31, 126,   0],\n",
       "       [109,   7, 137,   0],\n",
       "       [120,  42, 109,   0],\n",
       "       [ 79, 141, 100,   0],\n",
       "       [141,  86,  96,   0],\n",
       "       [132,  63,  59,   0],\n",
       "       [ 69,  11, 145,   0],\n",
       "       [ 51,  22,  99,   0],\n",
       "       [149,  29,  10,   0],\n",
       "       [ 16, 148, 148,   0],\n",
       "       [148, 136,  68,   0],\n",
       "       [ 10, 114, 143,   0],\n",
       "       [ 35, 147, 109,   0],\n",
       "       [ 71, 137,  98,   0],\n",
       "       [  1,  60, 145,   0],\n",
       "       [ 98,  10, 114,   0],\n",
       "       [130,  61, 139,   0],\n",
       "       [ 94,  50,  22,   0],\n",
       "       [ 64,  73,  53,   0],\n",
       "       [119,  12, 112,   0],\n",
       "       [  5,  12,   0,   0],\n",
       "       [107,  64, 101,   0],\n",
       "       [ 47,  26, 149,   0],\n",
       "       [120,  98,  82,   0],\n",
       "       [ 61,  75,  34,   0],\n",
       "       [148,  10,  87,   0],\n",
       "       [  9,  10, 129,   0],\n",
       "       [  2,  79,  67,   0],\n",
       "       [123,  29,  62,   0],\n",
       "       [  7, 129, 126,   0],\n",
       "       [ 99,  79,   1,   0],\n",
       "       [ 27, 119,  63,   0],\n",
       "       [ 85, 105,   0,   0],\n",
       "       [135, 146, 136,   0],\n",
       "       [ 90,  82,  83,   0],\n",
       "       [ 65,  66,  61,   0],\n",
       "       [ 36,  58,  14,   0],\n",
       "       [134, 107,  99,   0],\n",
       "       [ 85, 136,  32,   0],\n",
       "       [ 78,  38,  65,   0],\n",
       "       [ 68, 119, 135,   0],\n",
       "       [ 25, 143,   3,   0],\n",
       "       [ 13,  42,  81,   0],\n",
       "       [ 27,  53,  91,   0],\n",
       "       [114,  49,  66,   0],\n",
       "       [ 62, 117,  23,   0],\n",
       "       [ 96, 119,  27,   0],\n",
       "       [ 78,  80, 112,   0],\n",
       "       [122,  88,  94,   0],\n",
       "       [ 17,  42, 137,   0],\n",
       "       [ 85,  81,  64,   0],\n",
       "       [ 86,  74, 115,   0],\n",
       "       [ 10,  45, 141,   0],\n",
       "       [115,  68, 124,   0],\n",
       "       [123,  83, 141,   0],\n",
       "       [ 10,  82,   5,   0],\n",
       "       [ 51,   7,  81,   0],\n",
       "       [134,   5,  54,   0],\n",
       "       [ 95,  89,  25,   0],\n",
       "       [ 63, 104,  37,   0],\n",
       "       [ 92,  70,  43,   0],\n",
       "       [ 60,  81, 110,   0],\n",
       "       [ 55,   6,  45,   0],\n",
       "       [128,  89,  34,   0],\n",
       "       [ 85, 129,  39,   0],\n",
       "       [128, 102, 105,   0],\n",
       "       [ 41, 142, 105,   0],\n",
       "       [113,   5, 124,   0],\n",
       "       [ 40, 118,  68,   0],\n",
       "       [ 95,  23, 122,   0],\n",
       "       [ 83,  81,  56,   0],\n",
       "       [ 23,   2, 126,   0],\n",
       "       [ 14, 107, 125,   0],\n",
       "       [ 18, 112,  34,   0],\n",
       "       [ 92, 138,  46,   0],\n",
       "       [ 14,  19, 111,   0],\n",
       "       [ 81,  26, 115,   0],\n",
       "       [102, 111,  10,   0],\n",
       "       [ 65,  18,   5,   0],\n",
       "       [  8,  55,   5,   0],\n",
       "       [125, 117,   7,   0],\n",
       "       [ 92, 108,  80,   0],\n",
       "       [146,  87, 116,   0],\n",
       "       [ 33, 104,  43,   0],\n",
       "       [126,  67,  18,   0],\n",
       "       [ 79,  20,   0,   0],\n",
       "       [ 47,  21,  38,   0],\n",
       "       [ 94, 146, 137,   0],\n",
       "       [ 79,  39, 129,   0],\n",
       "       [149,  57,  68,   0],\n",
       "       [  5, 135,  51,   0],\n",
       "       [ 66,  15, 135,   0]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond=data[:,3]==0\n",
    "girls_scores=data[cond]\n",
    "girls_scores   # 先把女生的分数筛选出来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "20d712db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 0, 0])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " girls_scores.min(axis=0)  #最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "834e14a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 0, 0])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(girls_scores,axis=0) #最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "068aa944",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([150, 148, 149,   0])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "girls_scores.max(axis=0)  #最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "a880f811",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([150, 148, 149,   0])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " np.max(girls_scores,axis=0) #最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "05fe1631",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([76.33333333, 73.53333333, 73.80666667,  0.        ])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "girls_scores.mean(axis=0)  #平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "1bc424bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([76.33333333, 73.53333333, 73.80666667,  0.        ])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(girls_scores,axis=0)  #平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "432208c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([80.5, 74.5, 74.5,  0. ])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.median(girls_scores,axis=0)  #中位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "7e94c521",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([44.30149233, 43.7734572 , 44.89613148,  0.        ])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "girls_scores.std(axis=0) #标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "d5885c41",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([44.30149233, 43.7734572 , 44.89613148,  0.        ])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.std(girls_scores,axis=0) #标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "f3dbd459",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[130, 135, 126,   1],\n",
       "       [ 61, 107, 147,   1],\n",
       "       [ 21,  44,  92,   1],\n",
       "       [ 11,  66, 149,   1],\n",
       "       [ 98,  66,  72,   1],\n",
       "       [ 93,  44,  72,   1],\n",
       "       [129,   8,  26,   1],\n",
       "       [ 14,  99, 121,   1],\n",
       "       [ 58,  43, 144,   1],\n",
       "       [ 60,  15,  51,   1],\n",
       "       [ 57,  24, 109,   1],\n",
       "       [ 30,  51,  67,   1],\n",
       "       [  7,  26,  68,   1],\n",
       "       [142, 130,  84,   1],\n",
       "       [ 66,  33,  27,   1],\n",
       "       [115, 130,  38,   1],\n",
       "       [ 19, 145,  38,   1],\n",
       "       [150,  96, 138,   1],\n",
       "       [ 39,  76, 134,   1],\n",
       "       [ 19,  37,  88,   1],\n",
       "       [ 54, 100,  75,   1],\n",
       "       [ 12, 149,  15,   1],\n",
       "       [ 46,  41,  15,   1],\n",
       "       [ 51,  71,  31,   1],\n",
       "       [ 21, 142,  99,   1],\n",
       "       [129, 122,  11,   1],\n",
       "       [ 38,   7,  15,   1],\n",
       "       [110,  24,   0,   1],\n",
       "       [  5, 141,  87,   1],\n",
       "       [ 61,  44,  91,   1],\n",
       "       [ 99,   5, 113,   1],\n",
       "       [ 88,  97,  27,   1],\n",
       "       [ 36,  92, 148,   1],\n",
       "       [ 78,  21, 101,   1],\n",
       "       [ 36, 139,  97,   1],\n",
       "       [ 61,  97,  37,   1],\n",
       "       [ 63,  94,  55,   1],\n",
       "       [105,  74, 117,   1],\n",
       "       [ 83, 128, 147,   1],\n",
       "       [ 82, 124,  11,   1],\n",
       "       [ 13, 127,  16,   1],\n",
       "       [ 51,  63, 147,   1],\n",
       "       [ 26, 101, 103,   1],\n",
       "       [ 95,  16,  73,   1],\n",
       "       [ 49,  94,  36,   1],\n",
       "       [140, 146,  83,   1],\n",
       "       [128,  32, 128,   1],\n",
       "       [ 71, 126,  37,   1],\n",
       "       [ 65,   1,   5,   1],\n",
       "       [ 30,  75,  29,   1],\n",
       "       [ 33,   7,  57,   1],\n",
       "       [ 62, 122,  26,   1],\n",
       "       [ 33,  39, 139,   1],\n",
       "       [ 90, 142, 114,   1],\n",
       "       [113,  53, 117,   1],\n",
       "       [146,  13,  85,   1],\n",
       "       [130, 123,  60,   1],\n",
       "       [ 83,  52,  77,   1],\n",
       "       [ 62,  34, 137,   1],\n",
       "       [ 88,  73,  81,   1],\n",
       "       [ 99, 116,  23,   1],\n",
       "       [143,   5,  14,   1],\n",
       "       [111,  59,  36,   1],\n",
       "       [ 97,  70,  65,   1],\n",
       "       [ 83, 120,  46,   1],\n",
       "       [122,  86,  33,   1],\n",
       "       [ 45,  57,   5,   1],\n",
       "       [133,  81, 125,   1],\n",
       "       [  6,  62, 122,   1],\n",
       "       [ 17,  61, 113,   1],\n",
       "       [ 64,  59,  50,   1],\n",
       "       [ 47,  22,  15,   1],\n",
       "       [ 81,  17,  29,   1],\n",
       "       [ 19,   7, 116,   1],\n",
       "       [ 65,  64,  14,   1],\n",
       "       [ 20,  50, 117,   1],\n",
       "       [100,  26,  39,   1],\n",
       "       [119,  29,  40,   1],\n",
       "       [  8,  95,  91,   1],\n",
       "       [ 82,  64,  39,   1],\n",
       "       [ 62,  86, 147,   1],\n",
       "       [ 65, 103,  24,   1],\n",
       "       [  6,  51, 145,   1],\n",
       "       [ 98,  25, 146,   1],\n",
       "       [ 18,   4, 140,   1],\n",
       "       [148, 109,  23,   1],\n",
       "       [ 81, 100,  31,   1],\n",
       "       [ 43, 121,  89,   1],\n",
       "       [141,   8,   4,   1],\n",
       "       [ 33, 103,  41,   1],\n",
       "       [121,  39,  27,   1],\n",
       "       [ 79,  71,  49,   1],\n",
       "       [134, 120,  66,   1],\n",
       "       [118,  17,  64,   1],\n",
       "       [ 47,  63, 112,   1],\n",
       "       [ 70,  52,  75,   1],\n",
       "       [ 99,  46,  48,   1],\n",
       "       [ 18,  19,  77,   1],\n",
       "       [135,   4,  83,   1],\n",
       "       [ 92,  56, 108,   1],\n",
       "       [134,  89,  54,   1],\n",
       "       [ 73,  17,  37,   1],\n",
       "       [ 20,  43,  77,   1],\n",
       "       [ 15,   9,  98,   1],\n",
       "       [ 62, 132,  30,   1],\n",
       "       [120, 120,  78,   1],\n",
       "       [ 99,  82,  20,   1],\n",
       "       [ 31, 141,   6,   1],\n",
       "       [ 88,  66, 113,   1],\n",
       "       [110, 142,  99,   1],\n",
       "       [150, 125,  64,   1],\n",
       "       [ 61,  51,  12,   1],\n",
       "       [ 82,  99, 145,   1],\n",
       "       [100, 123, 101,   1],\n",
       "       [ 64, 108,  46,   1],\n",
       "       [ 11,  95, 107,   1],\n",
       "       [114, 125,  10,   1],\n",
       "       [127,  59, 122,   1],\n",
       "       [  1,  17,  40,   1],\n",
       "       [ 90, 107, 120,   1],\n",
       "       [ 30,  76,  13,   1],\n",
       "       [ 38, 103, 101,   1],\n",
       "       [ 93,   1, 141,   1],\n",
       "       [ 95,  49,  37,   1],\n",
       "       [ 25, 143,  13,   1],\n",
       "       [ 92,  91,  21,   1],\n",
       "       [101, 109,  67,   1],\n",
       "       [ 37,  54,  24,   1],\n",
       "       [ 94, 125,  29,   1],\n",
       "       [149, 150,  79,   1],\n",
       "       [ 44,  15, 131,   1],\n",
       "       [ 60,  85, 116,   1],\n",
       "       [132,  36,  58,   1],\n",
       "       [111,  57,  71,   1],\n",
       "       [ 86,  87,  79,   1],\n",
       "       [ 91,  44, 114,   1],\n",
       "       [ 89,  68,  17,   1],\n",
       "       [ 45, 150, 125,   1],\n",
       "       [ 63,  40,  84,   1],\n",
       "       [ 33,  27,  61,   1],\n",
       "       [ 60,  86,  44,   1],\n",
       "       [  6,  26, 132,   1],\n",
       "       [ 73,  58,   1,   1],\n",
       "       [ 14,  53,  63,   1],\n",
       "       [142,  46,  17,   1],\n",
       "       [ 86,   1, 109,   1],\n",
       "       [136, 100, 129,   1],\n",
       "       [ 41,  98,  97,   1],\n",
       "       [135, 138,   3,   1],\n",
       "       [ 55,  27,  50,   1]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond1=data[:,3]==1\n",
    "boys_scores=data[cond1]\n",
    "boys_scores  # 再男生的分数筛选出来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "a65dc8c1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 1, 0, 1])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_scores.min(axis=0)  #最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "3dcf18c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 1, 0, 1])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(boys_scores,axis=0) #最小值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "87c91b9c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([150, 150, 149,   1])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_scores.max(axis=0) #最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4d9e2449",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([150, 150, 149,   1])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.max(boys_scores,axis=0) #最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "ab49b87b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([73.08      , 71.77333333, 71.12666667,  1.        ])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_scores.mean(axis=0) #平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "231e3a98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([73.08      , 71.77333333, 71.12666667,  1.        ])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(boys_scores,axis=0) #平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "df214c27",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([70.5, 66. , 69.5,  1. ])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.median(boys_scores,axis=0) #中位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "3b0ae92f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([41.28688573, 43.03396281, 44.02852055,  0.        ])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_scores.std(axis=0)    #标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "04e4b90c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([41.28688573, 43.03396281, 44.02852055,  0.        ])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.std(boys_scores,axis=0) #标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ffa925cb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
